﻿<src:ejsManagerStage x:Class="SiliconStudio.Meet.EjsManager.ejsStage_Courses"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:SiliconStudio.Meet.EjsManager"
    >
    <Grid Background="{StaticResource StageBackground}" x:Name="_stageG_Courses">

        <Rectangle Grid.Column="0" Fill="{StaticResource StagePanelBackground}" StrokeThickness="1" Margin="16" Height="63"
                       HorizontalAlignment="Stretch" VerticalAlignment="Top" RadiusX="4" RadiusY="4" />
        
        <Label HorizontalAlignment="Left" Margin="16,16,0,0" VerticalAlignment="Top" Content="Courses" FontSize="16" />
        <Label HorizontalAlignment="Left" Margin="16,37,0,0" VerticalAlignment="Top" Content="Manage and Register Courses in the eJournal Server" FontSize="10" />

        
        
        <Grid Margin="16,80,16,67" DataContext="{Binding ElementName=_lv_CourseList, Path=SelectedItem, Mode=Default}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="300"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Rectangle Grid.Column="0" Fill="{StaticResource StagePanelBackground}" StrokeThickness="1" Margin="2"
                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RadiusX="4" RadiusY="4" />

            <Rectangle Grid.Column="1" Fill="{StaticResource StagePanelBackground}" StrokeThickness="1" Margin="2"
                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RadiusX="4" RadiusY="4" />

            <Label HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="Auto" Height="Auto" 
                   Content="Selected Course:" FontSize="12" Grid.Column="0"/>

            <TextBox TextChanged="_dv_CheckStringInput" MaxLength="150" Margin="8,51.81,8,0" VerticalAlignment="Top" Height="Auto" Text="{Binding _name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="NoWrap" x:Name="_tb_Name"/>
            <Label x:Name="_l_CourseName" HorizontalAlignment="Left" Margin="8,35.57,0,0" VerticalAlignment="Top" Width="Auto" Height="Auto" Content="Course Name:" FontSize="11" Padding="0,0,0,0"/>
            <TextBox TextChanged="_dv_CheckStringInput" MaxLength="500" Height="45" Text="{Binding _description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" Margin="8,99.57,8,0" VerticalAlignment="Top" x:Name="_tb_Description"/>
            <Label x:Name="_l_Description" Width="Auto" Height="Auto" Content="Description:" FontSize="11" Padding="0,0,0,0" HorizontalAlignment="Left" Margin="8,83.33,0,0" VerticalAlignment="Top"/>
            <CheckBox Margin="8,200,0,40" Height="Auto" IsChecked="{Binding _isActive, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Content="Is Active" x:Name="_cb_IsActive" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalAlignment="Left"/>
            <TextBox TextChanged="_dv_CheckStringInput" MaxLength="200" Height="Auto" Text="{Binding _owner, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="NoWrap" x:Name="_tb_Owner" Margin="8,167,8,0" VerticalAlignment="Top"/>
            <Label x:Name="_l_Owner" Width="Auto" Height="Auto" Content="Owner:" FontSize="11" Padding="0,0,0,0" HorizontalAlignment="Left" Margin="8,150,0,0" VerticalAlignment="Top"/>
            
            <Label HorizontalAlignment="Left" Margin="8,0,0,0" VerticalAlignment="Top" Width="Auto" Height="Auto" 
                   Content="All Courses:" FontSize="12" Grid.Column="1"/>

            <ListView Background="Transparent" ItemsSource="{Binding Mode=OneWay, Source={StaticResource CompleteCoursesList}}" 
                      IsSynchronizedWithCurrentItem="True" Grid.Column="1"
                      Margin="8,25,8,38" x:Name="_lv_CourseList"
                      ScrollViewer.HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Stretch"
                      View="{DynamicResource views_CoursesListView}"/>
            
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="8,0,0,8" VerticalAlignment="Bottom" Width="Auto">
                <Button Margin="2" Content="Update" Click="OnUpdateCurrentItem"/>
                <Button Margin="2" Content="Create New" Click="OnCreateNew"/>
                <Button Margin="2" Content="Delete" Click="OnDeleteCurrentItem"/>
            </StackPanel>
            
            <Button HorizontalAlignment="Right" Margin="0,0,8,8" VerticalAlignment="Bottom" Width="Auto" 
                    Height="Auto" Content="Update List" Grid.Column="1" Click="OnUpdateList"/>
        </Grid>
        
        <Label HorizontalAlignment="Left" Margin="16,8,0,40" VerticalAlignment="Bottom" Content="Warning:" FontSize="12" />
        <Label HorizontalAlignment="Left" Margin="16,8,0,27" VerticalAlignment="Bottom" Content="Changes are not saved until you Press the Update Button!" FontSize="10" />
        <Label HorizontalAlignment="Left" Margin="16,8,0,14" VerticalAlignment="Bottom" Content="All Fields must be filled in." FontSize="10" />
        
    </Grid>
</src:ejsManagerStage>
